Skip to content

chore(release): v2.6.0 with two npa stack-overflow fixes - #1935

Merged
dekobon merged 10 commits into
mainfrom
release/v2.6.0
Nov 17, 2026
Merged

dekobon merged 10 commits into
mainfrom
release/v2.6.0

Conversation

@dekobon

@dekobon dekobon commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

The eight commits that make up the v2.6.0 tag:

  1. fix(npa): unroll the Python and Elixir recursions fixes the two
    npa stack overflows reported in fix(npa): deep Python assignment chains and Elixir defstruct lists abort the process #1934. They are process aborts that
    one small bca-web request can trigger, and every interface that
    computes npa was exposed. It adds a CHANGELOG ### Security entry.
  2. fix(output): write CSV rows from an explicit stack fixes fix(output): the CSV writer recurses once per nested space and aborts on deep nesting #1936,
    which the PR review found: the same recursion-per-level abort in the
    CSV writer (bca metrics -O csv, write_csv, write_csv_aggregate).
    bca-web never emits CSV, so it goes under ### Fixed.
  3. perf(ast): skip field reads where no field exists fixes perf(web): /v1/ast export of a nested Tcl expr grows quadratically #1938: the
    AST export was quadratic in a Tcl expr's nested parentheses,
    because a cursor's field read climbs every hidden grammar level. A
    frame 32 or more children wide now asks the production field map
    first. New scaling probe dump/tcl-expr-parens.
  4. fix(web): stop a timed-out request's parse fixes fix(web): a parse past its deadline keeps running, so slow inputs exhaust the server into 503s #1939: a parse
    past its deadline is cancelled through tree-sitter's progress
    callback instead of running on as an orphan, so slow inputs (Perl
    -and => chains, perf(perl): tree-sitter-perl 1.1.2 parses -and => chains in quadratic time #1940) no longer drive the server into 503s. A
    second ### Security entry.
  5. fix(python): walk to a zero-width node's parent fixes fix(python): Node.parent and the sibling getters segfault on a deep zero-width node #1937: the
    bindings' Node.parent and sibling getters no longer recurse through
    tree-sitter on a zero-width (MISSING) node. The Rust Node::parent
    cannot be fixed the same way and is tracked in fix(ast): Node::parent on a deep zero-width node overflows the stack in tree-sitter #1941.
  6. fix(deps): bump actix-http for three advisories clears
    RUSTSEC-2026-0552, -0553 and -0554, published against actix-http
    3.21.0 while this PR was open (they turned cargo-deny red on the
    previous push). actix-http 3.21.0 → 3.22.0; no other package
    version moves. A third ### Security entry.
  7. docs(release): add the security-advisory step adds the
    post-publish step that SECURITY.md promises and RELEASING.md
    lacked: a GitHub advisory covering the crate and both PyPI packages,
    then a RustSec advisory aliasing it.
  8. chore(release): prepare v2.6.0 bumps the workspace and every
    lockstep pin from 2.5.2 to 2.6.0. It covers the five excluded
    grammar leaves and enums, the eight lockfiles, the role-coverage
    pin migration and observation, the regenerated man pages, the SARIF
    tool-version snapshots, and the reader-facing doc pins.
    ## [Unreleased] moves into ## [2.6.0] - 2026-11-16; the deferred
    3.0 MI note stays under [Unreleased], as at 2.5.0. It touches the
    same 55 files as the v2.5.0 prep commit. The recipes/ci.md pins
    move in the post-publish follow-up, as RELEASING.md prescribes.

Fixes #1934
Fixes #1936
Fixes #1937
Fixes #1938
Fixes #1939

Evidence

My measurements are on x86_64 Linux, rustc 1.99.1, release builds
(cargo build --release -p big-code-analysis-cli -p big-code-analysis-web).
base is main at 49dd7178 (the binary reports
git: 49dd71788eb9…); head is e38295c7 (git: e38295c7b09d…,
clean), the first review round's tip. The final tip leaves the npa and
CSV code these tables exercise unchanged.

The depth that aborts on the base depends on the build. The aarch64
column is the PR review's figures (rustc 1.99.0):

Input Interface base, x86_64 base, aarch64 (review)
Python a = a = … = 1 bca metrics --metrics npa survives 5,564 links, exit 134 from 5,582 survives 6,000, exit 134 from 6,445
Python a = a = … = 1 POST /v1/metrics server dies from 5,601 links (22,456-byte body) dies from 6,445 (25,829 B)
Elixir defstruct [[…:a…]] bca metrics --metrics npa survives 9,854 levels, exit 134 from 9,873 not measured
Elixir defstruct [[…:a…]] POST /v1/metrics server dies from 9,892 levels (19,856-byte body) dies from 9,228 (18,525 B)

Every interface that computes npa aborts the same way on the base and
passes at head:

Interface Input base head
bca check --no-config --threshold npa=1 Python 7,000 links / Elixir 20,000 levels 134 / 134 0 / 0
bca report -p same 134 / 134 0 / 0
bca metrics (every metric) Python and Elixir at 6,000, 20,000 and 100,000 levels 134 from the thresholds above 0 at every depth
POST /v1/metrics Python 24,052 B / Elixir 40,072 B server dies (134) 200, server up
PyPI big-code-analysis==2.5.1, analyze_source Python 6,000 / 20,000 links 0 / 139 (segfault) (review: passes at head)
PyPI big-code-analysis==2.5.1, analyze_source Elixir 20,000 / 100,000 levels 0 / 139 (segfault) (review: passes at head)

The Python bindings run the analysis on the calling thread (py.detach
releases the GIL but stays on it), so they need a deeper input than the
CLI's worker threads before they fault.

The CSV writer (#1936), JavaScript x = ()=>()=>…1;:

Command base, x86_64 head
bca metrics -O csv FILE survives 43,046 levels, 134 from 43,104 0 at 40,000 / 100,000 / 150,000
bca metrics -O csv --output-dir DIR FILE 134 at 100,000 and 150,000 0 at all three
bca metrics -O csv -o OUT FILE 0 at 150,000 (runs on main) 0 at all three, one row per level

With the recursion restored, the regression tests abort on their
512 KiB stacks at about 2,220 links (Python), 940 levels (Elixir) and
5,150 levels (CSV) in the test profile. The tests' depths (20,000,
20,000 and 50,000) sit 9x, 21x and 10x past the overflow depth.

Codecov's one patch miss on the first push (python.rs:175, the
unreachable else { return; } of a childless Assignment, re-indented
into the patch) is gone. The reader now iterates the chain with
successors and filter_map, and an llvm-cov run of the Python npa
tests hits every line of the function.

#1938: Tcl expr export

make bench-scaling, dump/tcl-expr-parens on the 4,000 / 8,000 /
16,000 ladder (bound 1.50):

Export Median ms Fit
reads every child's field (before) 41, 150, 623 1.95, over bound
asks the field map first (after) 4.9, 4.5, 9.9 0.50

On the 500-2,000 ladder the climbing export still fitted 0.82, which is
why the probe takes the taller one. a_wide_node_with_fields_keeps_them
(an 81-child Rust tuple-struct body) fails when wide nodes skip their
fields unconditionally.

#1939: cancelled parse

  • test_run_parse_timeout_stops_the_orphaned_parse: 4,000 Perl
    -and => pairs under a 200 ms deadline. The orphan ends about 26 ms
    after the deadline; with cancel.cancel() removed it is still running
    at the test's 10 s bound.

  • a_cancelled_parse_yields_an_empty_tree_and_a_clean_parser fails
    without the reset (0..96: the empty parse resumed the stopped one)
    and without the cancellation (0..4400).

  • Release servers, BCA_MAX_ORPHANED_TASKS=1, --parse-timeout-secs 2,
    one POST /v1/metrics of 8,000 pairs, then a small request at +0.5,
    +1, +3 and +10 s:

    Server Slow request Later small requests
    e38295c7 504 at 2.0 s 503, 503, 503, 503
    fixed 504 at 2.0 s 200, 200, 200, 200

#1937: zero-width parent in the bindings

  • the_root_walk_agrees_with_tree_sitter_where_it_is_safe: for every
    zero-width node of a 6-deep tree, the root walk's parent and siblings
    equal tree-sitter's.
  • a_deep_zero_width_node_finds_its_parent_on_a_small_stack: 20,000
    levels on a 512 KiB stack. Swapping the walk for
    tree_sitter::Node::parent aborts it (has overflowed its stack).
  • test_parent_and_siblings_of_a_deep_zero_width_node[3, 20000] through
    the Python getters. On the PyPI 2.5.1 wheel, parent and
    next_sibling exit 139 at 20,000 levels.

Gates (local)

At 3aa3a9f7 (the tip):

  • make pre-commit: BCA_GATE: pass (gate=pre-commit), 7,417 Rust tests and 413 Python tests
  • make release-check VERSION=2.6.0: passed (cargo-deny clean on all eight lockfiles, both license renders, the five leaf cargo publish --dry-runs, publish metadata, the [2.6.0] changelog section)

At d1ac55a7, whose code is the tip's apart from two tests and the actix-http lockfile entry:

  • make bench-scaling: all 140 probes within their complexity bound (dump/tcl-expr-parens 0.52)

make fuzz-check passed at the first push's prep commit; no fuzz input or fuzz lockfile has moved since.

Codecov

The previous push read 98.26% (2 misses, 2 partials) against the project's 98.57%. Two of the misses and one partial were a spin loop in a cancel test whose body only ran when the cancel lost a race; the test now orders the threads over a channel. The other partial was the ? on a row write in the CSV walk, pre-existing and re-indented into the patch: a_failing_sink_stops_the_row_walk now fails a sink mid-walk, and with the error swallowed it reads 1,979 write attempts against a full render's 65.

The [2.6.0] section is dated 2026-11-16; it gets the tag's date in a one-line amend of the prep commit when this lands.

@dekobon

dekobon commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

make release-check VERSION=2.6.0 at 24fd7f9e (clean committed tree, cargo-deny 0.20.2, cargo-about 0.9.1): passed.

  • cargo-deny across all eight lockfiles: no errors. The warnings are the usual informational ones (duplicate foldhash / hashbrown / syn, unused license allowances).
  • The two THIRD-PARTY-LICENSES renders succeed.
  • cargo publish --dry-run --locked of the five bca-tree-sitter-* leaves at 2.6.0 succeeds (upload aborted, as a dry run does).
  • publish metadata OK (4 publishable crates checked)
  • CHANGELOG.md contains section for [2.6.0]

@codecov

codecov Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.11321% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.59%. Comparing base (49dd717) to head (48f09a9).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
big-code-analysis-web/src/web/server.rs 80.00% 3 Missing and 1 partial ⚠️
src/output/csv.rs 95.65% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1935      +/-   ##
==========================================
+ Coverage   98.56%   98.59%   +0.02%     
==========================================
  Files         408      409       +1     
  Lines      127469   127746     +277     
  Branches   127034   127311     +277     
==========================================
+ Hits       125646   125956     +310     
+ Misses       1097     1069      -28     
+ Partials      726      721       -5     
Flag Coverage Δ
python 100.00% <ø> (ø)
rust 98.59% <98.11%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
big-code-analysis-ast/src/ast.rs 100.00% <100.00%> (ø)
big-code-analysis-ast/src/cancel.rs 100.00% <100.00%> (ø)
big-code-analysis-ast/src/langs.rs 95.26% <ø> (ø)
big-code-analysis-ast/src/node.rs 98.70% <ø> (ø)
big-code-analysis-ast/src/node/parser_cache.rs 100.00% <100.00%> (ø)
big-code-analysis-web/src/lib.rs 100.00% <ø> (ø)
src/metrics/npa.rs 100.00% <100.00%> (ø)
src/metrics/npa/elixir.rs 100.00% <100.00%> (ø)
src/metrics/npa/python.rs 97.93% <100.00%> (+0.39%) ⬆️
src/output/csv.rs 98.39% <95.65%> (+1.71%) ⬆️
... and 1 more

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dekobon

dekobon commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

Code Review: chore(release): v2.6.0 with two npa stack-overflow fixes

Verdict: APPROVE

Reviewed 49dd71788eb95251872e79cc268daed87025866b → 24fd7f9e88a2db757e37f4f72b5c9ed9ed1080c5 in an isolated checkout. No introduced or worsened findings survived verification at the ≥75% confidence threshold.

Severity Count
BLOCKER 0
CRITICAL 0
HIGH 0
MEDIUM 0

Findings

None. Python's loop preserves target traversal and name deduplication; Elixir's work list preserves terminal field counting. The two regression tests check exact counts at 20,000 levels on 512 KiB stacks. Release pins, all eight lockfiles, role records, documentation, man pages, and SARIF version updates are consistent. Third-party dependency records are unchanged.

Review passes executed

  • Correctness and architecture, with caller/callee tracing.
  • Bounded security review of both NPA fixes and their HTTP call paths, plus Semgrep.
  • Performance and scalability.
  • Regression-test quality and feature gates.
  • Release/dependency consistency and publication order.
  • Release documentation and generated-artifact consistency.

The dedicated @security agent could not start because its model requires Daybreak Red access; a read-only fallback reviewer completed the bounded security pass. LSP was unavailable, so references were traced with source searches.

Files reviewed: 58, including complete structural comparisons for mechanical release artifacts. Unchanged historical changelog prose was checked structurally rather than re-reviewed semantically.

Verification

  • Semgrep 1.173.0: 97 rules, 58 files, 0 findings, 0 errors.
  • make check-versions check-excluded-manifests check-manpage-assets verify-changelog VERSION=2.6.0: passed.
  • make check-test-lang-gates-compare COMPARE_REF=49dd71788eb95251872e79cc268daed87025866b: passed; no test lost a language build.
  • Freshly built 2.6.0 Python bindings, analyze_source(source, language) with all metrics: Python unique-name assignment chains and Elixir nested lists passed at 6,000 / 20,000 / 100,000 levels. Counts were respectively depth / 1. Both 20,000-level cases also passed on a Python worker configured with threading.stack_size(512 * 1024).
  • make fuzz-check: passed formatting, Clippy, all 5 harness tests, and the ASan target builds.
  • make pre-commit with rustc 1.99.0: BCA_GATE: pass (gate=pre-commit). All 7,407 workspace tests passed, including both new bounded-stack tests; 4 tests skipped and 1 doctest ignored. No unavailable-tool stage skips were reported.
  • Post-fix HTTP check using the gate-built target/debug/bca-web --host 127.0.0.1 --port <ephemeral> --num-jobs 1: JSON POST /v1/metrics with a 6,000-link Python repeated-name chain (24,049 bytes) and 20,000-level Elixir list (40,069 bytes) returned 200, exact attribute count 1, and a subsequent /v1/ping returned 200 after each request.
  • make bench-scaling: all 139 probes within their complexity bound, 7 rounds.

Pre-fix aborts were not independently rerun; the author's evidence was checked against the source paths. No fixes were made.

Comment thread CHANGELOG.md Outdated
a `SIGABRT`, not a catchable panic, so one request took `bca-web` down
with every request in flight: a single `POST /v1/metrics` of 24 KB
(Python) or 40 KB (Elixir), far inside the 4 MiB body cap, killed the
server. `bca metrics` aborted the same way on such a file. The Elixir

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Location: CHANGELOG.md:966

MEDIUM -- The Security entry names two affected interfaces; several more are affected

The entry names POST /v1/metrics and bca metrics. The same npa code runs behind other shipped interfaces, and each failed the same way before this fix. Measured on a release build of the base (49dd7178) and on the published wheel:

Interface Input Before the fix
bca check --threshold npa=1 FILE Python chain, 7,000 links exit 134
bca check --threshold npa=1 FILE Elixir list, 20,000 levels exit 134
bca report -p FILE either input exit 134
PyPI big-code-analysis==2.5.1, analyze_source(src, "python") Python chain, 20,000 links interpreter exits 139
PyPI big-code-analysis==2.5.1, analyze_source(src, "elixir") Elixir list, 100,000 levels interpreter exits 139

Exit 139 is a segmentation fault; the interpreter dies without the overflow message the Rust binaries print. Rust embedders that call analyze or Ast::metrics with npa selected are in the same position. Every row above exits 0 at head, and the bindings return the correct counts.

Not affected, also measured on the base: /v1/ast (500 from the depth bound), /v1/comment and /v1/function (200), bca ops, functions, dump, strip-comments, count, and bca metrics --metrics cyclomatic.

A reader who uses only the Python package, or only bca check, cannot tell from this entry that they need 2.6.0. Suggested change: say that every interface that computes npa was affected, and list them: the Rust API, the Python bindings, bca metrics, bca check with an npa threshold, bca report, and POST /v1/metrics.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, fixed in 3643223d. Reproduced on x86_64 Linux (rustc 1.99.1, release build of 49dd7178): bca check --no-config --threshold npa=1 and bca report -p exit 134 on both inputs (Python 7,000 links, Elixir 20,000 levels), and exit 0 at head. The PyPI 2.5.1 wheel's analyze_source exits 139 at 20,000 Python links and 100,000 Elixir levels, and passes at 6,000 and 20,000.

The entry now says every interface that computes npa was affected and lists them: the Rust API (analyze, or Ast::metrics with npa selected), the Python bindings, bca metrics, bca check with an npa threshold, bca report, and POST /v1/metrics. It also says the interpreter dies of a segmentation fault rather than an abort. #1934's body carries the same list.

Comment thread CHANGELOG.md Outdated
### Security

- Closed two remotely-triggerable process aborts in `npa` (#1934).
A Python class-level chained assignment `a = a = … = 1` some 5,000

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Location: CHANGELOG.md:959

LOW -- The Python figures do not reproduce at the base revision the PR names

The PR body gives pre as main at 49dd7178 and reports the Python chain aborting at 6,000 links, with a 24,052-byte request killing the server. On a release build of 49dd7178 (aarch64 Linux, rustc 1.99.0, cargo build --release --locked -p big-code-analysis-cli -p big-code-analysis-web):

Input Survives Aborts from
Python chain, POST /v1/metrics 6,420 links 6,445 links (25,829-byte body)
Python chain, bca metrics 6,000 links (exit 0) 6,445 links (exit 134)
Elixir list, POST /v1/metrics 9,203 levels 9,228 levels (18,525-byte body)

An older local build, 2.5.2 at 341f54b, does abort on the Python chain at 5,000 links, so the PR's Python numbers match that build and not 49dd7178. The same figures appear in this entry ("some 5,000 links", "24 KB"), in src/metrics/npa/python.rs:171 ("about 5,000 links") and in the test comment at src/metrics/npa.rs:4784 ("6,000 links aborted a release bca"). For Elixir, "some 20,000 brackets" and "40 KB" are about twice the measured minimum.

The overflow and the fix are not in question: head returns 200 at 100,000 levels for both inputs, and at 1,900,000 levels in a 3.8 MB body. The thresholds depend on the build. Either name the build they were measured on, or give them as approximate ("a few thousand links, under 30 KB"), and correct the pre revision in the PR's evidence table.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partly agree; fixed in 3643223d. The pre revision was right: the binary I measured reports git: 49dd71788eb9…. But it was built on x86_64 Linux with rustc 1.99.1, and there the base aborts earlier than on your aarch64 build. Bisected on that build:

Input Interface x86_64 (mine) aarch64 (yours)
Python chain bca metrics --metrics npa survives 5,564, 134 from 5,582 links 134 from 6,445
Python chain POST /v1/metrics dies from 5,601 links (22,456 B) from 6,445 (25,829 B)
Elixir lists bca metrics --metrics npa survives 9,854, 134 from 9,873 levels —
Elixir lists POST /v1/metrics dies from 9,892 levels (19,856 B) from 9,228 (18,525 B)

So the threshold depends on the build, and as you say, "some 5,000", "20,000 brackets" and "40 KB" were not minimums. The entry now gives the depths approximately ("a few thousand links", "about ten thousand brackets", "under 30 KB"), gives both platforms' thresholds, and says the depth varies with the build and the thread's stack. python.rs and both test comments no longer state a single figure, and the PR body's evidence table names the platform and toolchain.

@dekobon

dekobon commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

Location: SECURITY.md:39

MEDIUM -- The release steps do not include the RustSec advisory that SECURITY.md promises

SECURITY.md:34-42 says that once a fix is available the project publishes a patched release and then a RustSec advisory, with a CVE identifier where appropriate. RELEASING.md has no step for it, this PR adds none, and the repository has no security advisory, draft or published (gh api repos/dekobon/big-code-analysis/security-advisories returns []). The file is not part of this diff, so this is a note and not an inline comment.

It matters more than usual here because the exact inputs are already public: #1934 was opened on 2026-11-16 and this PR repeats them, while 2.5.1 is still the newest version on crates.io and PyPI. Without an advisory, cargo audit and cargo deny users are never told to move off 1.0.0 through 2.5.1.

Suggested follow-ups, none of which changes this diff:

  1. Publish 2.6.0 as soon as the gates allow, since the reproduction is public.
  2. Once 2.6.0 is on the registries, file the RustSec advisory, and a GitHub advisory so the PyPI package is covered too. Affected: >= 1.0.0, < 2.6.0 for the Elixir input and >= 2.0.0, < 2.6.0 for the Python input. Patched: >= 2.6.0.
  3. Add the advisory to the post-publish steps in RELEASING.md, so the next security release does not depend on someone remembering it.

@dekobon

dekobon commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner Author

Code Review, round 2 (security focus): chore(release): v2.6.0 with two npa stack-overflow fixes

Verdict: APPROVE WITH COMMENTS

Reviewed 49dd71788eb95251872e79cc268daed87025866b → 24fd7f9e88a2db757e37f4f72b5c9ed9ed1080c5 again, this time reproducing the vulnerability and searching for siblings of it. Both fixes remove the overflow they target, and nothing in the diff introduces a weakness. The comments are about the advisory text and the release steps.

Severity Count
BLOCKER 0
CRITICAL 0
HIGH 0
MEDIUM 2 on this diff, 2 pre-existing
LOW 1 on this diff, 1 pre-existing

Findings

# Severity File:Line Title Category
1 MEDIUM CHANGELOG.md:966 The Security entry names two affected interfaces; several more are affected security
2 MEDIUM SECURITY.md:39 The release steps do not include the RustSec advisory that SECURITY.md promises deploy-safety
3 LOW CHANGELOG.md:959 The Python figures do not reproduce at the base revision the PR names correctness

What was verified

Release builds of both revisions (cargo build --release --locked -p big-code-analysis-cli -p big-code-analysis-web, aarch64 Linux, rustc 1.99.0). The server ran as bca-web --num-jobs 1 --parse-timeout-secs 0.

The vulnerability and the fix, over POST /v1/metrics:

Input base 49dd7178 head 24fd7f9e
Python a = a = … = 1 survives 6,420 links, SIGABRT from 6,445 (25,829-byte body) 200 at 100,000 and at 1,900,000 links
Elixir defstruct [[…:a…]] survives 9,203 levels, SIGABRT from 9,228 (18,525-byte body) 200 at 100,000 and at 1,900,000 levels

On the base the server log ends with thread 'tokio-rt-worker' has overflowed its stack. bca metrics shows the same split: exit 134 on the base, exit 0 at head.

The regression tests can fail. With head's src/metrics/npa.rs placed on the base implementation, both new tests end the test binary with SIGABRT, and the older python_deeply_nested_unpacking_target_does_not_overflow_the_stack still passes.

The version claims hold. git log -S puts the Elixir recursion in 4fbe488e, first tagged v1.0.0, and the Python recursion in 0a27cd5f, first tagged v2.0.0.

No other abort was found through the server. A generator produced 978 deeply nested or chained inputs across 23 language variants (brackets, calls, operator and member chains, assignments, patterns, types, and nested functions, classes and modules). Each went to all four POST routes of the head server:

Pass Requests sent Depth Server deaths
1 3,912 up to 100,000 levels 0
2 3,908 up to 200,000 levels 0
3, near the 4 MiB cap 452 195,000 to 1,850,000 levels 0
4 to 6, unterminated and empty-middle variants (error-recovery trees) 6,264 up to 100,000 levels 0

13 of the 14,536 requests hit the client timeout before finishing, so for those the result is only "no abort within 60 or 180 seconds". Deep function nesting returns a clean 500 from the serialization depth bound. The harness was checked against the base first, where it reports the two known aborts.

Static pass. A script that lists self-calling functions, call cycles and self-nesting types flags both fixed functions on the base and neither at head. The candidates on the server's request path were read: the self-nesting result types have iterative drops and depth-bounded serializers, and the other hits there are bounded by the grammar or are name collisions.

Memory at the cap. The new Elixir work list does not raise peak memory: 799 MiB for the 1,900,000-level defstruct request against 797 MiB for the same nesting outside defstruct.

Dependencies. Third-party lockfile entries are unchanged from the base (round 1), and the cargo-deny job passed on this head.

Pre-existing issues outside this diff

The search also turned up three issues that predate this PR and are not caused by it. None of them makes bca-web abort, and none blocks this PR. They were first held back under SECURITY.md and are now published at the maintainer's request:

# Severity File:Line Title Category
4 MEDIUM src/output/csv.rs:247 CSV output still aborts on deeply nested functions security
5 LOW big-code-analysis-py/src/node.rs:460 Node.parent on a zero-width node deep in the tree kills the Python interpreter security
6 MEDIUM big-code-analysis-web/src/web/server.rs:157 Two small inputs keep a server thread busy for minutes performance

Review passes executed

  • Reproduction on release builds of base and head, over HTTP and the CLI
  • Claim-by-claim check of the CHANGELOG Security entry against source, git history and the published 2.5.1 artifacts
  • Patch review of both rewritten functions (termination, counts, memory)
  • Variant analysis: static enumeration, the request sweep above, and an 11,736-run sweep of CLI commands and output formats
  • Regression-test effectiveness
  • Release process against SECURITY.md and RELEASING.md

The dedicated @security agent failed on every attempt with a model access error, so four independent reviewers covered the static work: the AST crate, the result trees and server crate, the per-language metric code, and the claims and release process. A fifth reviewer's request was refused by its provider's content filter and its partition was reassigned. Between them they read the metric code, getters, checkers, language helpers, result trees and server crate in full. Comment removal, find/count and the preprocessor code were covered only by the scripts and the sweep.

Files reviewed: 58 in the diff (round 1), plus the request path and result-tree code outside it for this round. No fixes were made.

@dekobon

dekobon commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

Location: src/output/csv.rs:247

MEDIUM -- CSV output still aborts on deeply nested functions (pre-existing, not caused by this PR)

write_space_rows (src/output/csv.rs:240-250) calls itself once per nested FuncSpace, so its recursion depth follows the nesting of functions, classes or namespaces in the analysed file. It is the same failure this PR fixes in npa: a stack overflow, which ends the process instead of returning an error.

Measured on release builds (aarch64 Linux, rustc 1.99.0). The input is JavaScript: x = , then N copies of ()=>, then 1;.

Command Survives Aborts with exit 134
bca metrics -O csv FILE 32,362 levels from 32,421 levels (a 129,691-byte file)
bca metrics -O csv --output-dir DIR FILE not bisected at 100,000 levels
bca metrics -O csv -o OUT FILE 100,000 levels at 150,000 levels

With --output-dir the overflow message names a worker thread (Consumer N). With -o OUT it names main, which has the larger stack. The base (49dd7178) gave the same result at every depth tested (20,000, 50,000 and 100,000 levels to stdout; 100,000 and 150,000 with -o OUT), so this predates the PR.

In a sweep of 978 generated inputs through 12 CLI commands and formats (11,736 runs at head), 76 runs aborted, all of them metrics -O csv, across 19 language variants. On those 76 inputs -O json, -O yaml and -O toml exit 1 with a nesting-depth error, and functions and check exit 0. The default text output does not abort either: it completed in a separate run at 100,000 levels, and in the sweep it was still printing at the 20-second limit. Only the CSV writer is unbounded.

Reach: the CLI, and embedders through the public write_csv and write_csv_aggregate (src/lib.rs:297-298). bca-web cannot emit CSV (big-code-analysis-web/src/web/negotiate.rs:22-23), so the server is not affected.

This does not block the PR. It is worth deciding before the tag, though: the new changelog entry says bca metrics aborted on such files and no longer does, and with -O csv it still does on a different input. dump_space in src/output/dump_metrics.rs:104 already walks the same tree with an explicit stack. The CSV writer can do the same and keep its row order by pushing children in reverse. A test on a 512 KiB stack, like the two added here, would pin it.

@dekobon

dekobon commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

Location: big-code-analysis-py/src/node.rs:460

LOW -- Node.parent on a zero-width node deep in the tree kills the Python interpreter (pre-existing, in the tree-sitter runtime)

Node.parent and the sibling getters (big-code-analysis-py/src/node.rs:460, 466, 472, 478) call into tree-sitter's ts_node_parent. In the pinned runtime (tree-sitter = "=0.26.13", Cargo.toml:75), ts_node_child_with_descendant calls itself once per tree level when the node it is looking for is zero-width (src/node.c:560, self-call at :581). A MISSING node is zero-width, so asking for its parent costs one C stack frame per level of nesting above it.

Reproduction: the C source void f(){x = , then N × (, then N × ), then ;} parses with one zero-width MISSING identifier at the bottom. Take that node from Ast.parse(src, "c").root_node.walk() and read a property:

Build Property N Result
head bindings (maturin develop) parent 15,359 ok
head bindings parent 15,429 interpreter exits 139 (segmentation fault)
head bindings next_sibling, prev_sibling, next_named_sibling 20,000 exits 139 for each
head bindings text, Ast.find, descendants_by_kind 20,000 ok
PyPI big-code-analysis==2.5.1 parent 20,000; 200,000; 1,000,000 exits 139 each time

All of these ran on the interpreter's main thread. The 2.5.1 wheel shows this predates the PR.

I rate it LOW because the caller has to walk upward from a zero-width node. Code that reports parse errors by looking at the parent of each MISSING node does exactly that, though.

The server and the CLI did not reach it. 6,264 requests on error-recovery variants of the generated inputs (no closers, half the closers, an empty innermost level) left the head server alive, and that includes this C input at 100,000 levels on all four POST routes. 2,328 CLI runs on the empty-innermost variant, 108 of them C or C++, aborted only in the CSV writer.

Possible directions: report the recursion to tree-sitter, and in the bindings answer parent and the sibling getters without ts_node_parent, for example by descending from the root with a cursor, or refuse past a depth.

@dekobon

dekobon commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

Location: big-code-analysis-web/src/web/server.rs:157

MEDIUM -- Two small inputs keep a server thread busy for minutes (pre-existing, no abort)

Neither input kills the server, and neither is caused by this PR. They matter because a parse that passes the deadline is not cancelled. It is orphaned and keeps running (server.rs:157), and once max(n_threads * 2, 4) orphans exist (server.rs:263) every new request gets 503. A handful of these requests therefore takes the server out of service for as long as they run.

Times are from the head release server started with --parse-timeout-secs 0, so they are full run times. Other jobs were running on the machine, so read them as approximate.

1. Perl: $x = , then N × -and => , then 1;

N Body /v1/metrics /v1/function
2,000 16 KB 12.7 s 13.5 s
4,000 32 KB 61 s 79 s
8,000 64 KB over 300 s 241 s

bca count -t error on the same input takes 0.5 s, 2.7 s and 12.8 s at N = 500, 1,000 and 2,000, and strip-comments and metrics take as long. So the time goes into parsing with the pinned grammar (tree-sitter-perl = "=1.1.2", Cargo.toml:87) and not into any one walk. The same number of -foo => or of - takes about 0.02 s, so the slowdown is specific to -and. The base build is as slow: 2.1 s at N = 1,000.

2. Tcl and iRules: expr {, then N × (, then 1, then N × ), then }, on /v1/ast

N Body /v1/ast
4,000 8 KB 0.13 s
8,000 16 KB 0.49 s
16,000 32 KB 2.1 s
100,000 200 KB 40 s (Tcl), 60 s (iRules)

Each doubling costs about four times as much. /v1/metrics, /v1/comment and /v1/function take under 0.3 s on the 100,000-level input, so the parse is fine and the time goes into the AST export behind big-code-analysis-web/src/web/server/handlers.rs:142. expr {sin(sin(…))} behaves the same way: 2.6 s at 16,000 levels on /v1/ast, 0.03 s on /v1/metrics.

Possible directions: cancel the parse when the deadline passes instead of orphaning it, report the Perl case to the grammar, and add a scaling probe for the Tcl expr export. The existing dump/tcl-* probes in make bench-scaling cover eval nesting, not expr.

A Python class-level chained assignment a few thousand links long, or
an Elixir defstruct list nested about ten thousand brackets deep,
overflowed the thread stack and aborted the process: the Python reader
recursed once per link, the Elixir field count once per bracket. An
abort is not a catchable panic, so every interface that computes npa
died with it, and one POST /v1/metrics under 30 KB killed bca-web. The
depth varies with the build: release builds of the base aborted from
about 5,600 links and 9,900 levels on x86_64 Linux.

The Python reader now iterates the chain's links and the Elixir count
opens its wrappers from an explicit stack. Each gets a test on a
512 KiB stack at 20,000 levels; with the recursion restored they abort
at about 2,220 and 940 levels.

Fixes #1934
@dekobon

dekobon commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

Re the SECURITY.md:39 note: agreed, and we're keeping the promise rather than dropping it. f9641706 adds RELEASING.md#security-advisories, a post-publish step for a security release. Once the release is on crates.io and PyPI: (1) draft a GitHub advisory covering the big-code-analysis crate and both PyPI packages, requesting a CVE where appropriate; (2) open the RustSec advisory-db PR with the GHSA id in aliases; (3) publish the GitHub advisory. SECURITY.md's step 2 now mentions the GitHub advisory and links that step.

For 2.6.0 I'll draft both advisories after publish: affected >= 1.0.0, < 2.6.0 (Elixir; the Python reader from 2.0.0), patched >= 2.6.0, category denial-of-service.

The three pre-existing findings posted later are filed: #1936 (CSV writer recursion; fixed in this PR by 6f6e7499), #1937 (Node.parent on a deep zero-width node in the bindings), #1938 (quadratic /v1/ast export of nested Tcl expr) and #1939 (timed-out parses are orphaned, so slow inputs such as Perl -and => chains exhaust the server into 503s). I reproduced each on x86_64 before filing.

@dekobon

dekobon commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

Second round pushed (f19ce485), on the maintainer's decision to fix the review's pre-existing findings before tagging:

Tracked here rather than upstream, per the maintainer: #1940 (the Perl grammar's quadratic -and => parse) and #1941 (the Rust Node::parent, which cannot reach the tree root to take the bindings' route). The PR body has the evidence and the gates; all pass at the tip.

write_space_rows called itself once per nested FuncSpace, so a file
nesting a few tens of thousands of closures aborted bca metrics -O csv
and the public write_csv / write_csv_aggregate: from about 43,000
levels on an x86_64 release build. The rows now come from an explicit
stack, children pushed in reverse so the depth-first order is kept
(nested_spaces_flatten_depth_first pins it). A new test writes a
50,000-level space on a 512 KiB stack; with the recursion restored it
aborts at about 5,150 levels.

Fixes #1936
@dekobon

dekobon commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

Pushed 3aa3a9f7. CI on f19ce485 failed in cargo-deny: RUSTSEC-2026-0552, -0553 and -0554 were published against actix-http 3.21.0 in the meantime (they fail main too). f9328f93 moves it to 3.22.0, which carries all three fixes; utils/check-deny-manifests.sh passes on all eight lockfiles. The same push makes the cancel test deterministic and covers the CSV walk's error branch, the two Codecov gaps; details are in the PR body.

Comment thread RELEASING.md
crates.io and PyPI both carry the release: an advisory tells its
readers which version to install, so that version must resolve.

1. **Draft a GitHub advisory.** Under **Security → Advisories → New

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Location: RELEASING.md:227

MEDIUM — Select affected packages per vulnerability; the web package is missing

The new procedure applies to every own-code Security entry, but always names the big-code-analysis crate and both PyPI packages, and always files under crates/big-code-analysis/.

That list fits the NPA fixes, but this release also fixes the web-only timeout/orphan issue (#1939). The vulnerable orchestration is in big-code-analysis-web/src/web/server.rs:103-199; the published package is big-code-analysis-web (big-code-analysis-web/Cargo.toml:2). Neither Python wheel ships that server. Following this procedure for #1939 would omit the affected package and identify unaffected Python packages instead.

Choose the affected package names, ecosystems, version ranges, and RustSec directory for each vulnerability. Keep the current three-package list as an NPA example, and include big-code-analysis-web for the web-only fix.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, fixed in 377cbea5. The step now chooses packages per vulnerability. A library defect names the big-code-analysis crate and both PyPI packages; a bca-web-only one names the big-code-analysis-web crate alone. RustSec gets one file per affected crate under crates/<crate>/. The advisory text also names the release archives, which carry bca and bca-web and which no ecosystem covers. For 2.6.0 that means two advisories after publish: one for #1934 (the crate and both PyPI packages), one for #1939 (big-code-analysis-web).

Comment thread CHANGELOG.md Outdated
request body early; partial requests on a keep-alive connection could
bypass the request header timeout) by moving `actix-http` 3.21.0 →
3.22.0. All three reach `bca-web` only. No other package version or
checksum moved; five entries (`errno`, `rustix`, `rustls`,

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Location: CHANGELOG.md:1034

LOW — The changed dependency record is rustls-platform-verifier, not rustls

The windows-sys edge moved in rustls-platform-verifier 0.7.1 (Cargo.lock:3785-3803). The rustls record is unchanged. Comparing all 510 package records confirms the five edge-only changes are errno, rustix, rustls-platform-verifier, tempfile, and winapi-util; actix-http is the only package version/checksum change.

Replace rustls with rustls-platform-verifier in this list and the matching commit description if it is revised.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, fixed in 08267c18. The lockfile diff confirms the five re-pointed entries are errno, rustix, rustls-platform-verifier, tempfile and winapi-util. The commit message doesn't name them, so it is unchanged.

@dekobon

dekobon commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

Location: big-code-analysis-py/src/node.rs:503

LOW — Remaining #1937 caller: Node.field_name still crashes on the same zero-width node

The five changed parent/sibling getters now work on the original reproducer. field_name still calls self.node().parent()?, however, so it reaches the same recursive tree-sitter lookup.

Independently reproduced with freshly built bindings at 3aa3a9f799a82d60fb06e51c9ed37d55afed5bdf, aarch64 Linux, rustc 1.99.0:

import big_code_analysis as bca

n = 20_000
source = "void f(){x = " + "(" * n + ")" * n + ";}\n"
ast = bca.Ast.parse(source, "c")
missing = next(node for node in ast.root_node.walk() if node.is_missing)
print(missing.field_name)

At depth 3 this prints None and exits 0. At depth 20,000 the subprocess terminates with SIGSEGV (Python subprocess.returncode == -11). Each of parent, prev_sibling, next_sibling, prev_named_sibling, and next_named_sibling succeeds at both depths with the expected result.

This is a pre-existing residual, not a regression in the new walk. It is also separate from #1941: this Python getter can access the owning root just like the five fixed getters. Reuse the safe lookup here and add missing.field_name to the deep regression, or explicitly retain it as a follow-up before considering #1937 fully resolved.

children: Vec::with_capacity(node.child_count()),
children: Vec::with_capacity(width),
next_child: 0,
fields: width < FIELD_PROBE_WIDTH || has_field_child(&node),

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Location: big-code-analysis-ast/src/ast.rs:320

MEDIUM — Preserve inherited fields under wide ERROR nodes

has_field_child() is not equivalent to asking whether the cursor can report a child's field. An ERROR node has no production field map of its own, so child_by_field_id() finds nothing. Its hidden children can still carry fields, which the previous cursor/indexed lookups exposed. Once the error node has at least 32 children, this new gate suppresses all of those fields.

Reproduced at 3aa3a9f7 with freshly built Python bindings:

import big_code_analysis as bca

ast = bca.Ast.parse("struct T(" + "i32, " * 20, "rust")
error = next(node for node in ast.root_node.walk() if node.is_error)
print(error.child_count)  # 43
print(sum(error.field_name_for_child(i) == "type"
          for i in range(error.child_count)))  # 19

pending = [ast.dump()]
while pending:
    node = pending.pop()
    pending.extend(node["children"])
    if node["type"] == "ERROR":
        print(sum(child["field_name"] == "type"
                  for child in node["children"]))  # 0; should preserve 19

With 10 elements (23 children), the same unfinished construct retains all nine annotations. The new optimization therefore changes exported structure depending on width, affecting Ast::dump, Python Ast.dump, and /v1/ast on incomplete source. Both builders share this gate, so their parity test cannot catch it; the new valid tuple-struct fixture does not cover recovery nodes.

Keep per-child field reads for ERROR nodes, or use a predicate that also accounts for fields on their hidden children. Add a regression comparing the recovery-tree export with independently obtained raw field annotations on both sides of the threshold.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, fixed in a678fcb2. has_field_child now answers true for an ERROR node, so its children's fields are read one by one again. Your reproducer is now the regression test a_wide_error_node_keeps_its_childrens_fields. It parses an unfinished struct T( at 10 and 20 elements, which gives 23 and 43 children, one on each side of the probe width. It checks the raw field_name_for_child count (9 and 19; recovery leaves the first element without a field) and that both builders export exactly that many. Without the exception, the 43-child cursor export finds 0.

To check that nothing else is lost, I compared the export with the probe against the export without it, over every file in a supported language in the repository and its submodules. That is 15,405 files, each exported as written, truncated at its midpoint, and with a tenth cut out at the one-third mark: 46,215 exports through both builders. With the exception, none differ. As a positive control, without it 3,308 differ (C/C++, JS, Java, Python, C#, shell, Rust, Objective-C), 21 of them unmodified files.

The exception has a cost. An ERROR node over deeply nested hidden rules is quadratic again, as every node was in 2.5.1. expr {((…1…)) with its closing brace missing exports in 226 / 745 / 2,967 ms at 8,000 / 16,000 / 32,000 parentheses (debug-built extension), and the raw node carries no fields at all. That is tracked as #1942. Because it reopened the #1939 orphan through the export, 5606dcef also has the export check the cancel flag; see the round summary.

@dekobon

dekobon commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

Code Review, round 3: fixes from the previous review

Verdict: REQUEST CHANGES

Reviewed the 20-file delta from 24fd7f9e88a2db757e37f4f72b5c9ed9ed1080c5 to 3aa3a9f799a82d60fb06e51c9ed37d55afed5bdf. The original failure reproductions now pass, but the AST optimization introduces field-name loss on wide error-recovery nodes. That correctness regression should be fixed before merging. Two documentation findings and one pre-existing Python residual also remain.

Severity New findings Pre-existing residual
BLOCKER / CRITICAL / HIGH 0 0
MEDIUM 2 0
LOW 1 1

Findings

  1. MEDIUM — Wide recovery nodes lose inherited field names, big-code-analysis-ast/src/ast.rs:320. The new whole-parent predicate sees no field map on ERROR, but hidden children still carry fields. An unfinished Rust tuple struct with 20 elements has 19 raw type field annotations and exports zero. At width 31 it preserves 13 fields; at width 33 it drops all 14. This is an introduced correctness regression, affecting both builders and HTTP/Python AST export.

  2. MEDIUM — Choose advisory packages per vulnerability, RELEASING.md:227. The new procedure hardcodes the library and PyPI packages, omitting big-code-analysis-web for the web-only timeout fix.

  3. LOW — Incorrect dependency name, CHANGELOG.md:1034. The changed record is rustls-platform-verifier, not rustls.

  4. LOW, pre-existing — Node.field_name still segfaults, big-code-analysis-py/src/node.rs:503. It retains the native parent lookup on the same deep zero-width node. The five explicitly changed getters work; this remaining Python caller is not covered by the deferred Rust-wrapper issue fix(ast): Node::parent on a deep zero-width node overflows the stack in tree-sitter #1941.

Previous findings

  • CSV overflow: fixed. Release bca metrics --no-config -j 1 -O csv on "x = " + "()=>" * 150000 + "1;\n" exits 0 in stdout, -o FILE, and --output-dir DIR modes. Each emits exactly 150,002 rows, including the header and unit.
  • Python parent/siblings: fixed for all five changed getters. Each returns the expected value at depths 3 and 20,000. field_name returns None at 3 but terminates its subprocess with SIGSEGV (-11) at 20,000.
  • Tcl/iRules export: fixed on the reported performance shape, but its optimization causes the recovery-tree correctness regression above. /v1/ast with 100,000 nested expr parentheses returns 200 in approximately 0.079 s / 0.063 s, respectively, including response transfer. These are single-run observations.
  • Timed-out parsing: fixed on the reported Perl input. With BCA_MAX_ORPHANED_TASKS=1, --num-jobs 1 --parse-timeout-secs 2, 8,000 -and => pairs return 504 in 2.002–2.005 s on all four JSON routes and three octet-stream routes. A small request sent 0.5 s after each timeout returns 200; the four JSON follow-ups report the correct NPA count of 1. Work after parsing remains outside cancellation, as documented; grammar complexity remains tracked in perf(perl): tree-sitter-perl 1.1.2 parses -and => chains in quadratic time #1940.
  • NPA interface list and reproduction figures: corrected. The platform/toolchain-qualified evidence resolves the earlier discrepancy; different thresholds did not establish that the author's base revision was wrong.
  • Advisory release step: added, subject to the package-selection finding above. Actual advisory publication remains a post-release step.
  • Dependencies: only actix-http changes version/checksum (3.21.0 → 3.22.0); five other records change dependency edges. All eight manifest checks pass.

Verification

Host: aarch64 Linux, rustc 1.99.0. Fresh isolated worktree; make worktree-setup and cargo build --release --locked -p big-code-analysis-cli -p big-code-analysis-web succeeded.

  • make pre-commit: BCA_GATE: pass (gate=pre-commit); 7,417 Rust tests passed, 4 skipped; 413 Python tests passed, 1 expected failure; 1 ignored doctest. New CSV, parent-navigation, wide-field, cancellation and parser-reset regressions passed. Maturin warned that patchelf was absent when setting rpath; extension tests and stubtest still passed.
  • make bench-scaling: all 140 probes within their bounds, including dump/tcl-expr-parens.
  • utils/check-deny-manifests.sh advisories bans licenses sources: 8 manifests passed.
  • make check-test-lang-gates-compare COMPARE_REF=24fd7f9e88a2db757e37f4f72b5c9ed9ed1080c5: passed.
  • Semgrep 1.173.0: 1,247 rules, 20 files, 0 findings / 0 errors.
  • Independent parent/child enumeration: 1,230 navigation comparisons over 246 zero-width nodes from 1,116 shallow malformed inputs, including non-empty named-sibling results; no mismatches.
  • Valid wide export fixtures in 10 languages: 975 child-field comparisons, including 79 non-null fields; no mismatches. Additional unfinished Rust tuple-struct fixtures expose the field loss described above; the passing suite does not cover it.
  • Revised Python NPA iterator: exact counts on ordinary, unpacked, repeated-name and 100,000-distinct-name chains.
  • Current GitHub checks: 54 passed, 10 release/deployment jobs skipped by their conditions.

Review coverage and limits

Passes: correctness/API behavior, cancellation security and race/accounting review, AST/Python navigation performance, regression-test strength, and release/dependency consistency. Four independent read-only reviewers covered cancellation, Python navigation, AST export, and release documentation/dependencies. The dedicated security agent again failed before analysis with its Daybreak Red access requirement; the cancellation partition received a fallback review. LSP was unavailable, so call sites were traced through source searches.

The previous broad input sweep and pre-fix mutation experiments were not repeated. No fuzz files changed, so make fuzz-check was not rerun. Walk push/truncate bookkeeping is unchanged; the PR's chain-audit CI passed, and it was not repeated locally. The full release-publication dry-run was not repeated; dependency, metadata, version and man-page checks were covered by the local checks above. A Ruby performance candidate from static review was not promoted: it concerns a path unchanged by this fix and was not runtime-verified in this round. No production fixes, commits, or pushes were made.

Node.parent, the sibling getters and Node.field_name called
tree-sitter's lookups, and in the pinned runtime ts_node_parent asks
ts_node_child_with_descendant, which calls itself once per tree level
when the node it looks for is zero-width. A MISSING node is zero-width,
so asking for the parent, a sibling or the field name of one some
15,000 levels deep killed the interpreter.

For a zero-width node the bindings now walk down from the root with a
cursor, entering only the nodes whose span holds its position, read its
siblings off the parent found, and read its field from that parent's
cursor; a node with width keeps tree-sitter's iterative lookup. A Rust
test holds the walk to tree-sitter's answers for every zero-width node
of a shallow tree, and runs it 20,000 levels deep on a 512 KiB stack,
where tree-sitter's own parent() aborts. A Python test checks both
depths through the getters and field_name.

The Rust Node::parent cannot reach the root this way and still makes the
call; its doc says so, and #1941 tracks it. The PyNode baseline entries
record the getters' smaller method count.

Fixes #1937
RUSTSEC-2026-0552, -0553 and -0554 against actix-http 3.21.0 (bare LF in
chunked trailers, malformed quoted chunk extensions, and partial
requests bypassing the header timeout on keep-alive) turned cargo-deny
red on this release. cargo update -p actix-http moves it to 3.22.0,
which carries all three fixes; no other package version or checksum
moves, and five entries re-point an edge between windows-sys and
getrandom versions the lockfile already carried.
SECURITY.md promises a RustSec advisory once a fix ships, but
RELEASING.md had no step for it and none was ever filed. Add a
post-publish step for a security release: per vulnerability, a GitHub
advisory naming the packages that ship the vulnerable code (the
library crate and both PyPI packages for a library defect, the
big-code-analysis-web crate alone for a server one), then a RustSec
advisory per affected crate aliasing it.
The --parse-timeout-secs doc comment ended "(issue #707)", which clap
renders into bca-web --help and cargo xtask into man/bca-web.1. Issue
references belong in // comments, as bca's own help test holds for
that binary. A cli_smoke test now fails on any #NN to #NNNN in
bca-web --help; it failed on #707 before the move.
The manifest said actix negotiates HTTP/2 only through TLS ALPN, so the
http2 feature bought nothing on bca-web's plaintext socket. actix-web
4.19 would also accept prior-knowledge h2c there. The note now says
so; dropping the feature still stands, for the h2 0.3 advisory.
@dekobon
dekobon merged commit 48f09a9 into main Nov 17, 2026
64 checks passed
@dekobon
dekobon deleted the release/v2.6.0 branch November 18, 2026 02:31

This branch was successfully deployed

3 active and 1 inactive deployments
release — 48f09a9c Deployed Nov 17, 2026 by dekobon via publish to crates.io #17
pypi-cli — 48f09a9c Deployed Nov 17, 2026 by dekobon via publish to PyPI #224
pypi — 48f09a9c Deployed Nov 17, 2026 by dekobon via publish to PyPI #185
github-pages — 48f09a9c Deployed Nov 17, 2026 by dekobon via deploy to GitHub Pages #1097
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment